import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String[] arr = new String[]{"void", "main", "int", "printf", "if", "for"};
        char[] arrCh = new char[]{'+', '-', '*', '/', '%', '='};
        StringBuilder ss = new StringBuilder();
        while(in.hasNextLine()){
            String line = in.nextLine();
            if(line.contains("#")){
                int pos = line.indexOf('#');
                for(int i = 0;i < pos;i++){
                    ss.append(line.charAt(i));
                }
                break;
            }
            ss.append(line);
        }
        String str = ss.toString();
        int i = 0;
        while (i < str.length()) {
            char c = str.charAt(i);
            if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
                StringBuilder s = new StringBuilder();
                while (i < str.length() && (str.charAt(i) >= 'a' && str.charAt(i) <= 'z' || str.charAt(i) >= 'A' && str.charAt(i) <= 'Z')) {
                    s.append(str.charAt(i++));
                }
                for (int j = 0; j < arr.length; j++) {
                    if (arr[j].equals(s.toString())) {
                        System.out.println((j + 1) + "  " + arr[j]);
                    }
                }
            } else {
                for (int k = 0; k < arrCh.length; k++) {
                    if (c == arrCh[k]) {
                        System.out.println((401 + k) + "  " + arrCh[k]);
                        break;
                    }
                }
                i++;
            }
        }
    }
}
